-
Notifications
You must be signed in to change notification settings - Fork 746
Let torchaudio.load() and torchaudio.save() rely on load_with_torchcodec() and save_with_torchcodec().
#4039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/audio/4039
Note: Links to docs will display an error until the docs builds have been completed. ❌ 8 New FailuresAs of commit 498ce49 with merge base 02351a6 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Installing ffmpeg>4, which is necessary for torchcodec to be able to load files used during testing, seems to be incompatible with the current CI infrastructure. Perhaps we need a separate PR to install ffmpeg>4, and wait for the infrastructure to improve so that that PR can be merged. |
|
I'm coming across an interesting discrepancy in the An easy fix here is just to use |
|
Your assessment on However, this entire file is meant to test the old torchaudio Now that we are moving Basically, we can just skip them safely. Just add a big |
|
Now we're failing because |
|
I'm going to remove the installation of torchcodec during testing, as it shouldn't be used anyway. We should rely on the mock. |
6d2ba1b to
c3d0cc2
Compare
torchaudio.load() and torchaudio.save() rely on load_with_torchcodec() and save_with_torchcodec().
src/torchaudio/__init__.py
Outdated
| from typing import Union, BinaryIO, Optional, Tuple | ||
| import os | ||
| import torch | ||
| import sys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sys doesn't seem to be used
|
we just updated our torchaudio pin to 09/06 (as we're preparing to update the pin to release branch) and it is now saying torchcodec is not found. We can add torchcodec now in our CI and dependencies but shouldn't the proper fix be to install torchcodec as part of install_requires=[] in setup.py? See error below
```
2025-09-10T11:41:20.8448305Z adding 'executorch-0.8.0a0+4d6209b.dist-info/METADATA' |
|
Hi @mergennachin ,
But ultimately, we still want users (e.g. possibly Executorch) to move away from those, and take a hard, explicit dependency on TorchCodec. What you're doing in pytorch/executorch#14147 is a good temporary workaround. As a result we're not adding TorchCodec as a dependency of TorchAudio: only the users of |
This PR wraps the
load_with_torchcodecandsave_with_torchcodecfunctions with functions of the nameloadandsaveso that code that depends on the oldloadandsavefunctions can continue to work in the future once we remove backend-specific code.